package com.java.common.pojo;

/**
 * ComputerRoomId entity. @author MyEclipse Persistence Tools
 */

public class ComputerRoomId implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1205942753154639269L;
	// Fields

	private Computer computer;
	private Room room;

	// Constructors

	/** default constructor */
	public ComputerRoomId() {
	}

	/** full constructor */
	public ComputerRoomId(Computer computer, Room room) {
		this.computer = computer;
		this.room = room;
	}

	// Property accessors

	public Computer getComputer() {
		return this.computer;
	}

	public void setComputer(Computer computer) {
		this.computer = computer;
	}

	public Room getRoom() {
		return this.room;
	}

	public void setRoom(Room room) {
		this.room = room;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof ComputerRoomId))
			return false;
		ComputerRoomId castOther = (ComputerRoomId) other;

		return ((this.getComputer() == castOther.getComputer()) || (this
				.getComputer() != null
				&& castOther.getComputer() != null && this.getComputer()
				.equals(castOther.getComputer())))
				&& ((this.getRoom() == castOther.getRoom()) || (this.getRoom() != null
						&& castOther.getRoom() != null && this.getRoom()
						.equals(castOther.getRoom())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getComputer() == null ? 0 : this.getComputer().hashCode());
		result = 37 * result
				+ (getRoom() == null ? 0 : this.getRoom().hashCode());
		return result;
	}

}